import { download } from './../smartMarketing/newLottery';
import request from '@/utils/request'

/**
 * 订单管理 订单列表
 * @param data
 * @returns
 */
export const getOrderList = (data: any) => {
  return request({
    url: '/scrm-api/console/retail/transaction/list',
    method: 'POST',
    data
  })
}

/**
 * 订单管理 导出订单
 * @param data
 * @returns
 */
 export const exportOrders = (data: any) => {
  return request({
    url: '/scrm-api/console/retail/transaction/export',
    method: 'POST',
    data
  })
}

/**
 * 订单管理 导入订单
 * @param data
 * @returns
 */
export const importOrders = (data: any) => {
  request.defaults.timeout = 60000
  return request({
    url: '/scrm-api/console/retail/transaction/import',
    method: 'POST',
    data
  })
}

/**
 * 订单管理 订单来源列表
 * @param data
 * @returns
 */
 export const getOrderSourceList = (data: any) => {
  return request({
    url: '/scrm-api/console/retail/transaction/get-source-list',
    method: 'GET',
    params: data
  })
}

/**
 * 订单管理 导入订单 查看店铺列表
 * @param data
 * @returns
 */
 export const getOrderStoreList = (data: any) => {
  return request({
    url: '/scrm-api/console/retail/transaction/get-shop-list',
    method: 'GET',
    params: data
  })
}

/**
 * 订单管理 导入订单 下载模版
 * @param data
 * @returns
 */
 export const downloadTemplate = (data: any) => {
  return request({
    url: '/scrm-api/console/retail/transaction/template',
    method: 'GET',
    params: data
  })
}

/**
 * 订单管理 直接同步
 * @param data
 * @returns
 */
 export const synchronous = (data: any) => {
  return request({
    url: '/scrm-api/console/retail/order/sync',
    method: 'POST',
    data
  })
}

/**
 * 订单管理 高级同步
 * @param data
 * @returns
 */
 export const synchronousPro = (data: any) => {
  return request({
    url: '/scrm-api/console/retail/order/advance-sync',
    method: 'POST',
    data
  })
}

/**
 * 订单管理 上传数量
 * @param data
 * @returns
 */
export const getExcelNum = (data: any) => {
  request.defaults.timeout = 60000
  return request({
    url: '/scrm-api/console/retail/transaction/get-excel-num',
    method: 'POST',
    data
  })
}

/**
 * 订单管理 获取导入订单结果
 * @param data
 * @returns
 */
export const getExcelResult = (data: any) => {
  return request({
    url: '/scrm-api/console/retail/transaction/import-result',
    method: 'GET',
    params: data

  })
}

//各店铺订单状态列表
export const getOrderState = () => {
  return request({
    url: '/scrm-api/console/retail/order/get-order-state-list',
    method: 'GET'
  })
}

//订单详情
export const getOrderDetail = (data: any) => {
  return request({
    url: '/scrm-api/console/retail/order/get-order-detail',
    method: 'GET',
    params: data
  })
}

//各模板导入模板下载
export const downloadCommon = (data: any) => {
  return request({
    url: '/scrm-api/console/common/download-temp',
    method: 'GET',
    params: data
  })
}
